blob: 928aa72f3317bf2b43d9bc07f9cacaaa01034f38 [file] [log] [blame]
Aaron Colwellc6841a02014-03-07 01:37:561<!DOCTYPE html>
2<html>
3 <head>
Aaron Colwellaa3c90b2014-08-04 17:58:374 <title>Simple MediaSource playback test case.</title>
Aaron Colwell06f8ec22014-03-07 18:09:475 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
Aaron Colwellc6841a02014-03-07 01:37:567 <script src="mediasource-util.js"></script>
Aaron Colwellc6841a02014-03-07 01:37:568 </head>
9 <body>
10 <div id="log"></div>
11 <script>
12 mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
13 {
14 test.failOnEvent(mediaElement, 'error');
15 test.endOnEvent(mediaElement, 'ended');
16
Aaron Colwellcffb8af2014-05-23 22:27:1017 test.expectEvent(sourceBuffer, 'updatestart', 'sourceBuffer');
18 test.expectEvent(sourceBuffer, 'update', 'sourceBuffer');
19 test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer');
Aaron Colwellc6841a02014-03-07 01:37:5620
21 sourceBuffer.appendBuffer(mediaData);
Aaron Colwellcffb8af2014-05-23 22:27:1022
23 test.waitForExpectedEvents(function()
24 {
25 assert_false(sourceBuffer.updating, "updating");
26 assert_greater_than(mediaSource.duration, 1, "duration");
27
28 mediaSource.duration = 1;
29
30 assert_true(sourceBuffer.updating, "updating");
31 test.expectEvent(sourceBuffer, 'updatestart', 'sourceBuffer');
32 test.expectEvent(sourceBuffer, 'update', 'sourceBuffer');
33 test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer');
34 });
35
36 test.waitForExpectedEvents(function()
37 {
38 mediaSource.endOfStream();
39 mediaElement.play();
40 });
James Graham1da64702015-05-01 12:22:2241 }, "Test normal playback case with MediaSource API");
Aaron Colwellc6841a02014-03-07 01:37:5642 </script>
43 </body>
44</html>